home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / newsgroups / misc.20000114-20000217 / 000147_news@columbia.edu _Wed Jan 26 09:57:56 2000.msg < prev    next >
Internet Message Format  |  2020-01-01  |  4KB

  1. Return-Path: <news@columbia.edu>
  2. Received: from newsmaster.cc.columbia.edu (newsmaster.cc.columbia.edu [128.59.59.30])
  3.     by watsun.cc.columbia.edu (8.8.5/8.8.5) with ESMTP id JAA12796
  4.     for <kermit.misc@watsun.cc.columbia.edu>; Wed, 26 Jan 2000 09:57:56 -0500 (EST)
  5. Received: (from news@localhost)
  6.     by newsmaster.cc.columbia.edu (8.8.5/8.8.5) id JAA12359
  7.     for kermit.misc@watsun.cc.columbia.edu; Wed, 26 Jan 2000 09:47:41 -0500 (EST)
  8. X-Authentication-Warning: newsmaster.cc.columbia.edu: news set sender to <news> using -f
  9. From: fdc@watsun.cc.columbia.edu (Frank da Cruz)
  10. Subject: Re: Case Study #10: Atomic File Movement
  11. Date: 26 Jan 2000 14:47:39 GMT
  12. Organization: Columbia University
  13. Message-ID: <86n1eb$c24$1@newsmaster.cc.columbia.edu>
  14. To: kermit.misc@columbia.edu
  15.  
  16. In article <86llha$40u$1@news.value.net>,
  17. Mark Sapiro  <msapiro@value.net> wrote:
  18. : Frank posted a tutorial on the features in C-Kermit for "atomic"
  19. : file movement.
  20. : I won't quote it here as it is readily available at
  21. : http://www.columbia.edu/kermit/case10.html
  22. : It seems to me however, that there must still be a window, albeit
  23. : a small one during which a connection can be lost and the sender
  24. : will believe the file has been successfully sent and the receiver
  25. : will not or vice versa.
  26. : I don't know the details of the protocol well enough to know exactly
  27. : what scenario can occur, but I assume the sender sends a "file complete"
  28. : packet of some kind.  Perhaps this packet gets lost when the connection
  29. : goes down.  The sender may assume the file is successfully sent, but
  30. : the receiver doesn't know it.
  31. : Or perhaps the sender needs an ACK to this packet which the receiver
  32. : sends and this is the packet that is lost.  Then the receiver knows
  33. : it has received the whole file, but the sender doesn't.
  34. : Am I missing something here, or is this a problem?
  35. As Joe explained, the file sender sends an End-of-File (Z) packet after
  36. the end of the file.  So the sender knows the whole file was sent.
  37.  
  38. The file receiver might or might not get the Z packet.  If the Z packet
  39. does not arrive, the protocol times out and recovery action is taken;
  40. ultimately the Z packet is retransmitted until an affirmative response
  41. is received, or the retranmission limit is exceeded, or the connection
  42. is observed to be broken.  In any of these failure cases, the sender
  43. knows the transfer was not successful, and therefore does not delete,
  44. move, or rename the source file.
  45.  
  46. Once the file receiver gets the Z packet, it acknowledges it.  The file
  47. sender might or might not get the acknowledgement.  If it doesn't, the
  48. protocol times out and recovery action is taken.  If the recovery action
  49. fails, the sender does not know if the transfer was successful, and
  50. therefore does not delete, move, or rename the source file.
  51.  
  52. If the sender receives the acknowledgement, it knows that the receiver got
  53. the whole file, and so it can delete, move, or rename it.
  54.  
  55. Therefore, any error condition -- including loss of connectivity --
  56. triggers the conservative response: keep the source file.  It is better to
  57. send it more than once than less than once.  By design, the protocol might
  58. seem to fail when it succeeds, but it should never seem to succeed when
  59. it fails.
  60.  
  61. By the way, what makes Kermit somewhat immune to the two-armies problem,
  62. also known as the three-way-handshake problem, is that the Z packet and
  63. its ACK are not the final stage of Kermit protocol; the file receiver does
  64. exit the protocol or close the connection after acknowledging the Z
  65. packet.  In fact, the whole protocol is protected by an "outer layer" that
  66. has no consequences at the file level.  If this outer layer is disturbed
  67. at the end (in the typical case, by premature disconnection) there might
  68. be an annoying delay, but no harm is done.
  69.  
  70. - Frank
  71.  
  72. P.S. I should have mentioned in the original posting that the rename
  73. operation does not work across physical disks in operating systems such
  74. as Unix; this was corrected in the web-page version.